package com.springcloud.entities;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Payment implements Serializable {
    private Long id;
    private String serial;

    public Payment(Build build){
        this.id = build.id;
        this.serial = build.serial;
    }

    public static class Build{

        private Long id;
        private String serial;

        public Build(){}

        public Build id(Long id){
            this.id = id;
            return this;
        }

        public Build serial(String serial){
            this.serial = serial;
            return this;
        }

        public Payment build(){
            return new Payment(this);
        }
    }
}
